<?php
/*
 * name: cxm
 * desc: 邮储食堂正式会员申请表
 * date: 2020/08/11
 * */
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class CreateRegularUserApplyTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('regular_user_apply', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('用户ID');
            $table->string('name')->comment('姓名');
            $table->string('mobile')->comment('联系方式');
            $table->tinyInteger('is_card')->default(2)->comment('是否办理工会卡 1是 2否');
            $table->tinyInteger('is_foot')->default(2)->comment('是否办理邮储食堂卡 1是 2否');
            $table->tinyInteger('status')->default(2)->comment('是否处理 1是 2否');
            $table->string('dispose_remark')->nullable()->comment('处理意见、备注');
            $table->timestamp('dispose_time')->nullable()->comment('处理时间');
            $table->timestamps();
            $table->softDeletes();
        });
        // 表注释
        DB::statement("ALTER TABLE `".config('database.connections.mysql.prefix')."regular_user_apply` comment'邮储食堂正式会员申请表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('regular_user_apply');
    }
}
